
***Note: replicators should set directory to open data 
*cd ""

*Also note data are in .sav format, need to be put in stata

********** FIGURE 2f: Religious Attitudes, India **********

*Based on Indian data from Social attitudes research, see appendix. Original dataset: https://riceinstitute.org/data/social-attitudes-research-india-sari-data/ 

clear all
use SARI.dta

drop if D==0
 label var D "Discriminatory attitudes"
 label var PD "Perceptions of discrimination"

   
tostring State, generate(state) 

la def ss2 1 "Bihar" 2 "Jharkhand" 3 "Dehli" 4 "Maharashtra" 5 "Mumbai" 6 "Rajasthan" 7 "Uttar Pradesh"

reg    PD D
ereturn list
loc N6= e(N)
local b= round(_b[D],.001)
local t = _b[D]/_se[D]
local p =round(2*ttail(e(df_r),abs(`t')),.001)


   grstyle init
 grstyle set legend 2,  nobox
 grstyle set size 8pt: tick_label key_label
 grstyle set size 12pt: heading
 grstyle set size 10pt: subheading axis_title 
 grstyle set graphsize 13cm 11.5cm


  graph twoway    (lfitci PD  D,   lcol(black)  lwidth(medthick) ciplot(rline) blpattern(dash) acolor(black%65) )     (scatter PD  D if Area==1,   mcolor(black)   msymbol(d))   (scatter PD  D if Area==2,   mcolor(black)   msymbol(S)) (scatter PD  D if Area==3,   mcolor(black)   msymbol(o) ) (scatter PD  D if Area==4,   mcolor(black)   msymbol(T) ),  name(a, replace)    legend(position(12) rows(1)  order(3 "City" 4 "Town" 5 "Village" 6 "Own field") span) ytitle("Perceptions of discrimination")    xtitle("Discriminatory attitudes") subtitle("{bf: Islamophobia in India}") note("Author's computations based on Social Attitudes Research India." "Plot country-round pairwise correlation. {&rho} = `b' | {it:p-value} = `p' | {it:N} = `N6'.", size(vsmall) span)
  graph export "Graph/Figure2f.tif", replace 
  graph save "Graph/Figure2f", replace
 
 
